package com.qyl.homework;

import com.qyl.mainclass.Animal;

public class Dog extends Animal{

    //super调用父类有参构造器
    public Dog(String name, int age, String color, String type){
        super(name, age, color, type);
    }

    //调用父类无参构造器
    public Dog(){
        super();
    }

    //将父类的基本行为方法重写
    @Override//表示方法被重写
    public void drink(){
        System.out.println(getName() + "需要舔着喝水。");
    }

    @Override
    public void sleep(){
        System.out.println(getName() + "需要趴着睡觉。");
    }

    @Override
    public void eat(){
        System.out.println(getName() + "需要吃骨头。");
    }

    public void sound(){
        System.out.println(getName() + "汪汪汪叫。");
    }
}
